#include "highgui.h"
#include "cv.h"
#include <stdio.h>
int main(int argc,char** argv){
	IplImage* in=cvLoadImage(argv[1],1);
	//cvNamedWindow("in",1);
	//cvShowImage("in",in);
	//cvWaitKey(0);
	//cvDestroyWindow("in");
	int argument=atoi(argv[2]);//argument works 5~9
	printf("argument=%d\n",argument);
	IplImage* out=cvCreateImage(
		cvGetSize(in),
		IPL_DEPTH_8U,
		3
	);
	cvSmooth(in,out,CV_MEDIAN,argument,0,0.0,0.0);
	//cvNamedWindow("out",1);
	//cvShowImage("out",out);
	cvSaveImage("smooth_out.jpg",out,0);
	cvReleaseImage(&out);
	//cvWaitKey(0);
	//cvDestroyWindow("in");
	//cvDestroyWindow("out");
	return 0;

}
